import java.util.Scanner;

public class CarTest {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Car c = new Car();
        CarEngine e = new CarEngine();
        System.out.println("请输入汽车品牌：");
        c.carBrand = input.next();
        System.out.println("请输入汽车颜色：");
        c.colour = input.next();
        System.out.println("请输入汽车价格：");
        c.price = input.nextDouble();
        c.show();
        System.out.println("请输入发动机品牌");
        e.brand = input.next();
        System.out.println("请输入发动机重量");
        e.weight = input.nextDouble();
        System.out.println("请输入发动机马力");
        e.horsepower = input.nextDouble();
        System.out.println("请输入发动机排量");
        e.displacement = input.nextDouble();
        e.show();
        for (;;){
            System.out.println("请选择操作：1.启动汽车，2.熄火，3.鸣笛，4.下车");
            int a = input.nextInt();
            if (a==1){
                System.out.println("是否启动汽车？回复：启动/不启动");
                String select = input.next();
                e.CarStart(select);
                if (select.equals("不启动"))
                    System.out.println("好的");
            }
            if (a==2){
                System.out.println("是否熄火？回复：熄火/不熄火");
                String select = input.next();
                e.Flameout(select);
                if (select.equals("不熄火"))
                    System.out.println("车辆继续行驶");
            }
            if (a==3){
                System.out.println("是否鸣笛？回复：是/否");
                String select = input.next();
                c.whistle(select);
                if (select.equals("否"))
                    System.out.println("车辆继续行驶");
            }
            if (a==4){
                System.out.println("下车啦");
                break;
            }

        }

    }
}
